/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __XOS_STL_POOL_MACRO_H__
#define __XOS_STL_POOL_MACRO_H__

#include "fake_lock.h"
#include "xos_group.h"
#include "item_list.h"
#include "item_map.h"
#include "interface_list.h"
#include "xos_pool.h"

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 
// 方便声明和定义xos_pool,xos_group指针变量的宏
// 

#define XOS_STL_DECLARE_AND_DEFINE_GROUP( x, X, SNUM, INUM ) \
			typedef xos_stl::xos_group< x, SNUM, INUM > X##_GROUP;\
			X##_GROUP * x##_group_ptr;

#define XOS_STL_DECLARE_AND_DEFINE_LIST( x, X, lock ) \
			typedef xos_stl::item_list< x, lock > X##_LIST;\
			typedef X##_LIST::ITER X##_LIST_ITER;\
			X##_LIST * x##_list_ptr;

#define XOS_STL_DECLARE_AND_DEFINE_MAP( key, x, X, lock ) \
			typedef xos_stl::item_map< key, x, lock > X##_MAP;\
			typedef X##_MAP::ITER X##_MAP_ITER;\
			X##_MAP * x##_map_ptr;

#define XOS_STL_DECLARE_AND_DEFINE_POOL( x, X, lock ) \
			typedef xos_stl::xos_pool< x, lock > X##_POOL;\
			X##_POOL * x##_pool_ptr;

#endif // __XOS_STL_POOL_MACRO_H__
